<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>结构伪类选择器-基本使用</title>
    <style>
        li:first-child {
            background-color: green;
        }

        li:last-child{
            background-color: beige;
        }
        li:nth-child(4){
            background-color: blue;
        }
    </style>
</head>

<body>
    <ul>
        <li>li 1</li>
        <li>li 2</li>
        <li>li 3</li>
        <li>li 4</li>
        <li>li 5</li>
        <li>li 6</li>
        <li>li 7</li>
        <li>li 8</li>
    </ul>
</body>

</html>